package com.onpositive.data.serializer.writers;

@SuppressWarnings("rawtypes")
public abstract class CompoundWriter extends AbstractWriter<Object>{

	
	public CompoundWriter(AbstractWriter nestedWriter) {
		super( Object.class );
		this.nestedWriter = nestedWriter;
	}

	final AbstractWriter nestedWriter;
	
	public abstract Object convert(Object value);
	

	@SuppressWarnings("unchecked")
	@Override
	public void append(Object obj) {
		nestedWriter.append(convert(obj));
	}
}
